<template>
	<view class="m30">
		<view class="mb30" v-for="(item,index) in listData" :key="index" @click="nologinJump('/pages/contacts/msgDetail?id='+item.id)">
			<view class="textC f24 c343 mb20">{{item.createTime}}</view>
			<view class="bgFff radius30 p30">
				<view class="f28 bold c343">{{item.title}}</view>
				<view class="c666 f26 mt10 mb20">
					{{item.intro}}
				</view>
				<!-- <view class="flex">
					<u-image src="https://cdn.uviewui.com/uview/swiper/swiper1.png" mode="" width="30px"
						height="30px" shape="circle"></u-image>
					<view class="ml20">
						<view class="c343 f26">昵称</view>
					</view>
				</view> -->
				<u-line color="#eee" margin="20rpx 0"></u-line>
				<view class="flex-au">
					<u-button shape="circle" color="#FEF4E8" :customStyle="{'color':'#FF7F1C','width':'40%'}">去看看</u-button>
				</view>
			</view>	
		</view>
	</view>
</template>

<script>
	import {getNoticelist} from '@/common/api_user.js'
	export default {
		name: 'msg',
		data() {
			return {
				listData:[],
				lastPage: false,
				page: 1,
				pageSize: 15
			}
		},
		onLoad() {
			this.getNoticelist()
		},
		onReachBottom() {
			if(!this.lastPage){
				this.page = this.page + 1
				this.getNoticelist()
			}
		},
		methods: {
			async getNoticelist() {
				const that = this
				const res = await getNoticelist({
					type:'3',
					pageNum: this.page,
					pageSize: this.pageSize
				})
				if(res.code == 200){
					this.listData = this.listData.concat(res.rows)
					this.lastPage = res.lastPage
				}
			},
		}
	}
</script>

<style>
	
</style>